#%RAML 1.0
title: Party API
baseUri: http://localhost:8081
version: v1

documentation:
  - title: mod-users API
    content: This documents the API calls that can be made to query and manage users of the system

types:
  readerCreditRecord: !include readerCreditRecord.json
  readerCreditRecordCollection: !include readerCreditRecordCollection.json
  readerBlackList: !include readerBlackList.json
  errors: !include raml-util/schemas/errors.schema

traits:
  orderable: !include raml-util/traits/orderable.raml
  pageable: !include raml-util/traits/pageable.raml
  searchable: !include raml-util/traits/searchable.raml
  language: !include raml-util/traits/language.raml
  validate: !include raml-util/traits/validation.raml
  facets: !include raml-util/traits/facets.raml

resourceTypes:
  collection: !include raml-util/rtypes/collection.raml
  collection-item: !include raml-util/rtypes/item-collection.raml
  get-only: !include raml-util/rtypes/get-only.raml
  post-empty-body: !include raml-util/rtypes/post-empty-body.raml
  collection-get: !include raml-util/rtypes/collection-get.raml


/party/reader/credit/record:
  type:
    collection:
      exampleCollection: !include examples/readerCreditRecordCollection.sample
      exampleItem: !include examples/readerCreditRecord.sample
      schemaCollection: readerCreditRecordCollection
      schemaItem: readerCreditRecord
  get:
    is: [
      searchable: {description: "", example: "active=true sortBy username"},
      pageable,
      validate
    ]
  post:
    is: [validate]

  /modify/{id}/and/{recordId}:
      displayName: readerCreditRecord
      description:  获取，删除或更新黑名单用户
      type:
         collection-item:
            schema: readerCreditRecord
            exampleItem: !include examples/readerCreditRecord.sample

  /admin/commit:
      displayName: readerBlackList
      description:  管理员添加黑名单用户
      type:
         post-empty-body:
           schema: readerBlackList
           exampleItem: !include examples/readerBlackList.sample